/**
 * 	 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
 *   @author Colin Redmond
 *   Copyright (C) 2011 Colin Redmond
 *
 *   Licensed under the Apache License, Version 2.0 (the "License");
 *   you may not use this file except in compliance with the License.
 *   You may obtain a copy of the License at
 *
 *       http://www.apache.org/licenses/LICENSE-2.0
 *
 *   Unless required by applicable law or agreed to in writing, software
 *   distributed under the License is distributed on an "AS IS" BASIS,
 *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *   See the License for the specific language governing permissions and
 *   limitations under the License.
 */
package com.cred.industries.platform.business.objects.builders;

import java.util.HashMap;
import java.util.Map;

import org.joda.time.DateTime;

import com.cred.industries.platform.business.objects.MetricsBO;

/**
 * 
 *
 */
public class MetricsBOBuilder {
	
	private String mMetricType = "";
	private int mSourceCustId = -1;
	private int mTargetCustId = -1;
	private DateTime mTime;
	
	private Map<String, Integer> mIntMetrics = new HashMap<>();
	private Map<String, Float> mFloatMetrics = new HashMap<>();
	private Map<String, String> mStringMetrics = new HashMap<>();

	public MetricsBOBuilder(String metricType, int sourceCustId, DateTime time) {
		mMetricType = metricType;
		mSourceCustId = sourceCustId;
		mTime = time;
	}

	public String getMetricType() { return mMetricType; }
	public MetricsBOBuilder setMetricType(String val) { mMetricType = val; return this;}
	public int getSourceCustId() { return mSourceCustId; }
	public MetricsBOBuilder setSourceCustId(int custId) {  mSourceCustId = custId; return this;}
	public int getTargetCustId() { return mTargetCustId; }
	public MetricsBOBuilder setTargetCustId(int custId) {  mTargetCustId = custId; return this;}
	public DateTime getTime() {	return mTime; }
	
	public MetricsBOBuilder addInt(String name, Integer value) { mIntMetrics.put(name, value); return this;}
	public MetricsBOBuilder addFloat(String name, Float value) { mFloatMetrics.put(name, value); return this;}
	public MetricsBOBuilder addString(String name, String value) { mStringMetrics.put(name, value); return this;}
	
	public MetricsBO build() {
		
		return new MetricsBO(mMetricType, mSourceCustId, mTargetCustId, mTime, mIntMetrics, mFloatMetrics, mStringMetrics);
	}
}
